﻿<div class="m-portlet m-portlet--full-height ">
    <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
            <div class="m-portlet__head-title">
                <h3 class="m-portlet__head-text">
                    <font style="vertical-align: inherit;">
                        <font style="vertical-align: inherit;">
                            我委托的人
                        </font>
                    </font>
                </h3>
            </div>
        </div>
        <div class="m-portlet__head-tools">
            <button (click)="openAddMemberModal()" class="btn btn-primary float-right mb-3">
                <i class="fa fa-plus"></i> 添加委托人
            </button>
        </div>
    </div>
    <div class="m-portlet__body" [busyIf]="blockedDelegationList">
        <div class="tab-content">
            <div class="tab-pane active" id="m_widget4_tab1_content">
                <div class="m-widget4 m-widget4--progress">
                    <div class="m-widget4__item" *ngFor="let viewDelegation of viewDelegations">
                        <div _ngcontent-kgw-c100="" class="kt-widget4__pic kt-widget4__pic--pic ng-star-inserted">
                            <mat-slide-toggle [checked]="viewDelegation.openedStatus" [(ngModel)]="viewDelegation.openedStatus" (click)="changeDelegationState(viewDelegation.delegationId,viewDelegation.openedStatus)">
                                <div class="m--font-focus">{{viewDelegation.openedStatus ? '激活' : '关闭'}}</div>
                            </mat-slide-toggle>
                        </div>
                        <div class="m-widget4__info">
                            <span class="m-widget4__title">
                                <font style="vertical-align: inherit;">
                                {{viewDelegation.userId}}
                                </font>
                            </span><br>
                            <div [ngSwitch]="viewDelegation.userName">
                                <div *ngSwitchCase="">
                                    <div class="m-loader m-loader--warning" style="width: 30px; display: inline-block;"></div>
                                </div>
                                <div *ngSwitchDefault>
                                    <span class="m-widget4__sub">
                                         <font style="vertical-align: inherit;" >                                                      
                                            {{viewDelegation.userName}},{{viewDelegation.ouName}}                                                   
                                         </font>
                                    </span>
                                </div>
                            </div>

                        </div>
                        <div class="m-widget4__progress">


                        </div>
                        <div class="m-widget4__ext">
                            <button mat-mini-fab (click)="delDelegation(viewDelegation.delegationId)">
                                        <i class="fa fa fa-trash-alt"></i>
                                </button>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>

<addMemberModal #addMemberModal (membersAdded)="addMembers($event)"></addMemberModal>

<!--end:: Widgets/User Progress -->